from flask import Blueprint,request
from .person_center import Person_Center

app_person = Blueprint('app_person',__name__)

@app_person.route('/lastmessage',methods=['GET'])
def new_message():
    with Person_Center() as PC:
        result = PC.last_message()
    return result

@app_person.route('/allmessage/<int:user_id>',methods=['GET'])
def messages(user_id):
    with Person_Center() as PC:
        result = PC.all_message(user_id)
    return result
